package com.boco.webmaster.common.taglib;

import javax.servlet.jsp.*;
import javax.servlet.jsp.tagext.*;
import org.apache.commons.lang.StringUtils;
import com.boco.wmworkflow.attemp.action.AttempJspHelper;
import com.boco.wmworkflow.attemp.dto.AttempCustomAttribute;

public class AttempCustomAttributeTag extends TagSupport{
    private String attributeName;

    public AttempCustomAttributeTag() {
    }

    public int doStartTag() throws JspException {
        AttempCustomAttribute customAttr = AttempJspHelper.getCustomAttributeByName(attributeName);
        if (customAttr.isIsShow()) {
            pageContext.setAttribute(attributeName, customAttr);
            return EVAL_BODY_INCLUDE;
        } else {
            return SKIP_BODY;
        }
    }

    public String getAttributeName() {
        return attributeName;
    }

    public void setAttributeName(String attributeName) {
        this.attributeName = attributeName;
    }
}
